﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Table_pet.background;
using Table_pet.background.Classes;
using static Google.Protobuf.Reflection.SourceCodeInfo.Types;

namespace Table_pet
{
    public partial class AddMemorandumList : Form
    {
        public AddMemorandumList(Point location)
        {
            InitializeComponent();
            dateTimePicker2.Format = DateTimePickerFormat.Custom;
            dateTimePicker2.CustomFormat = "MM/dd/yyyy hh:mm:ss";
            dateTimePicker2.Location = new Point(12, 25);
            this.Location = location;
        }

        public AddMemorandumList(Point location, Memorandum memorandum)
        {
            InitializeComponent();
            dateTimePicker2.Format = DateTimePickerFormat.Custom;
            dateTimePicker2.CustomFormat = "MM/dd/yyyy hh:mm:ss";
            dateTimePicker2.Location = new Point(12, 25);
            dateTimePicker2.Value = memorandum.date;
            textBox1.Text = memorandum.content;
            this.Location = location;
        }

        private void AddMemorandumList_Load(object sender, EventArgs e)
        {

        }

        private void dateTimePicker2_ValueChanged(object sender, EventArgs e)
        {

        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            DB_api.AddMemorandumDate(new Memorandum(dateTimePicker2.Value, textBox1.Text, 0));
            this.Close();
        }
        /*public new void Close()
        {
            
            DB_api.AddMemorandumDate(new Memorandum(dateTimePicker2.Value, textBox1.Text, 0));
            base.Close();
        }*/
    }
}
